-
Notifications
You must be signed in to change notification settings - Fork 38.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce cache for speeding up APIServices lookup #79999
Conversation
/assign @deads2k |
/cc @liggitt |
staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller.go
Outdated
Show resolved
Hide resolved
staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller.go
Outdated
Show resolved
Hide resolved
staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller.go
Outdated
Show resolved
Hide resolved
given the volume of endpoint updates, I think optimizing getAPIServicesFor is probably worthwhile, but I would recommend something more like #79999 (comment) this will also need thorough tests to prove that APIService additions/updates/removals result in the proper map of service-namespace/service-name -> apiservice name list |
and since this is being done in service of performance, quantifying the gain with a unit test benchmark is recommended |
/hold |
@liggitt I will work on benchmark next. |
ceb7366
to
66b0c27
Compare
For benchmark test, I was looking at endpoints_controller_test.go |
@deads2k |
@liggitt thanks |
This looks reasonable to me. @deads2k can take a look early next week and it should be good to merge after that |
@deads2k thanks |
@deads2k |
staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller.go
Show resolved
Hide resolved
staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller.go
Outdated
Show resolved
Hide resolved
staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller.go
Show resolved
Hide resolved
staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller.go
Show resolved
Hide resolved
staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller.go
Outdated
Show resolved
Hide resolved
@deads2k thanks |
@deads2k |
staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller.go
Show resolved
Hide resolved
6f6c2a0
to
7db2c85
Compare
@liggitt |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liggitt, tedyu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest Review the full test history for this PR. Silence the bot with an |
1 similar comment
/retest Review the full test history for this PR. Silence the bot with an |
@tedyu: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
This PR addresses the TODO item above AvailableConditionController#addService
A cache is introduced into AvailableConditionController. In getAPIServicesFor, we check whether the v1.Service reference has been queried before.
If so, return the cached result directly.